package com.hc.service.impl;

import com.hc.bean.User;
import com.hc.dao.UserDao;
import com.hc.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service("userServiceImpl2")
@Transactional
public class UserServiceImpl2 implements UserService {
//    @Autowired
    @Resource
    private UserDao userDao;

    @Override
    public List<User> findAll() {
        return userDao.findAll();
    }

    @Override
    public List<User> findUserByName(String name) {
        return userDao.findUserByName(name);
    }

    @Override
    public Integer addUser(User user) {
        return userDao.addUser(user);
    }

    @Override
    public Integer updateUser(User user) {
        return userDao.updateUser(user);
    }

    @Override
    public Integer deleteUser(Integer uid) {
        return userDao.deleteUser(uid);
    }

    @Override
    public User getUserById(Integer uid) {
        return userDao.getUserById(uid);
    }
}
